package com.badibadi.activity;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.json.JSONException;

import com.badibadi.fragment.BaseFragment;
import com.badibadi.infos.Record_List_Model;
import com.badibadi.infos.Results;
import com.badibadi.mytools.BitmapHelp;
import com.badibadi.mytools.CommonUtils;
import com.badibadi.mytools.Constants;
import com.badibadi.mytools.JSONUtils;
import com.badibadi.mytools.MyThreadTool;
import com.badibadi.mytools.TabHostUtils;
import com.badibadi.mytools.Utils;
import com.badibadi.uniclubber.R;
import com.nostra13.universalimageloader.core.DisplayImageOptions;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.display.RoundedBitmapDisplayer;
import com.view.my_view.XListView;
import com.view.my_view.XListView.IXListViewListener;

import android.os.Bundle;
import android.os.Handler;
import android.os.Message;
import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.Intent;
import android.support.v4.app.Fragment;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TabHost;
import android.widget.TextView;
import android.widget.Toast;

/**
 * my_record_list_bottom_button my_record_record 俱乐部记录列表
 * my_record_list_bottom_button
 */
public class RecordListClubActivity extends RecordAdayToRememberActivity {
	private MyRecordList0Fragment_1 fragment_1;
	private Bundle bun;
	// private TabHost mtabhost;
	// private RelativeLayout bottom_btn1, bottom_btn2;
	private String cid, is_join = null, c_name = null, admin_id = null,
			apply_id = null, gold = null, price = null;
	private String is_apply;
	private AlertDialog builder;
	private Button record_linear_add_club, record_linear_quxiao,
			my_record_record;
	private Results resultsdd;
	private int pos = 0;
	private Handler handler = new Handler() {
		@Override
		public void handleMessage(Message msg) {
			switch (msg.what) {
			case 1:
				try {
					Utils.ExitPrgress(RecordListClubActivity.this);
					Utils.showMessage(RecordListClubActivity.this,
							getResources().getString(R.string.l_net_error));
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			case 2:
				try {
					Utils.ExitPrgress(RecordListClubActivity.this);
					Utils.showMessage(RecordListClubActivity.this,
							resultsdd.getRetmsg());
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			case 3:
				try {
					Utils.ExitPrgress(RecordListClubActivity.this);
					Utils.showMessage(RecordListClubActivity.this,
							getResources().getString(R.string.l_xa10));
				} catch (Exception e) {
					// TODO: handle exception
				}

				break;
			default:
				break;
			}
		}
	};

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		// this.findViewById(R.id.my_record_list_bottom_button).setVisibility(
		// View.GONE);
		// init();
		LoadingFragment("1");
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub
		// super.init();
		try {
			cid = getIntent().getStringExtra("cid");
			is_join = getIntent().getStringExtra("is_join");
			c_name = getIntent().getStringExtra("c_name");
			is_apply = getIntent().getStringExtra("is_apply");
			admin_id = getIntent().getStringExtra("admin_id");
			apply_id = getIntent().getStringExtra("apply_id");
			gold = getIntent().getStringExtra("gold");
			price = getIntent().getStringExtra("price");
			// intent.putExtra("apply_id",
			// personalCenterHomePageModel2
			// .getApplyTableId());
		} catch (Exception e) {
			// TODO: handle exception
		}
		// cid = "11";
		((TextView) (this.findViewById(R.id.my_record_tiltle))).setText(c_name
				+ "的记录");
		this.findViewById(R.id.my_record_list_return_btn).setOnClickListener(
				new View.OnClickListener() {
					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						finish();
					}
				});
		this.findViewById(R.id.my_record_record).setOnClickListener(
				new OnClickListener() {

					@Override
					public void onClick(View arg0) {
						// Toast.makeText(getApplicationContext(), "新增记录", 0)
						// .show();
						
							if (is_join != null && is_join.equals("0")) {
								builder = new Builder(
										RecordListClubActivity.this).setView(
										Back_Buju()).show();
							} else {
								// Constants.is_shuaxin = true;
								Intent intent = new Intent(
										RecordListClubActivity.this,
										AddingRecordNewActivity.class);
								intent.putExtra("cid", cid);
								startActivity(intent);
							}
						
					}
				});
		mtabhost = (TabHost) findViewById(R.id.my_record_tabhost);
		mtabhost.setup();// 放在获取地址的后面
		mtabhost.addTab(mtabhost
				.newTabSpec("my_record one")
				.setIndicator(getResources().getString(R.string.Newest),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab1));
		mtabhost.addTab(mtabhost
				.newTabSpec("my_record two")
				.setIndicator(getResources().getString(R.string.Hot),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab2));
		mtabhost.addTab(mtabhost
				.newTabSpec("my_record three")
				.setIndicator(getResources().getString(R.string.VoteRanking),
						getResources().getDrawable(R.drawable.ic_launcher))
				.setContent(R.id.tab3));
		TabHostUtils.SetTabHost(this, mtabhost);
		mtabhost.setOnTabChangedListener(new TabHost.OnTabChangeListener() {
			@Override
			public void onTabChanged(String tabId) {
				// TODO Auto-generated method stub
				switch (mtabhost.getCurrentTab()) {
				case 0:
					LoadingFragment("1");
					break;
				case 1:
					LoadingFragment("2");
					break;
				case 2:
					LoadingFragment("3");
					break;
				default:
					LoadingFragment("1");
					break;
				}
			}
		});
		bottom_btn1 = (RelativeLayout) findViewById(R.id.my_record_bottom_btn1);
		bottom_btn2 = (RelativeLayout) findViewById(R.id.my_record_bottom_btn2);
		bottom_btn1.setVisibility(View.GONE);
		bottom_btn2.setVisibility(View.GONE);

		this.findViewById(R.id.my_record_list_bottom_button).setVisibility(
				View.GONE);
	}

	/**
	 * 根据num来读取framgent
	 * 
	 * @param num
	 */
	private void LoadingFragment(String type) {
		ViewFragmentHolder holder = new ViewFragmentHolder();
		fragment_1 = new MyRecordList0Fragment_1();
		bun = new Bundle();
		bun.putString("type", type);
		fragment_1.setArguments(bun);
		holder.transaction.replace(R.id.my_record_layout, fragment_1);
		holder.transaction.commit();
	}

	private View Back_Buju() {
		View view = null;
		LayoutInflater inflater = LayoutInflater
				.from(RecordListClubActivity.this);
		view = inflater.inflate(R.layout.recordlistclub_is_add_club, null);
		record_linear_add_club = (Button) view
				.findViewById(R.id.record_linear_add_club);

		TextView infos = (TextView) view.findViewById(R.id.infos);
		infos.setText(getResources().getString(R.string.l_xb134));

		record_linear_quxiao = (Button) view
				.findViewById(R.id.record_linear_quxiao);
		record_linear_add_club.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				// Toast.makeText(getApplicationContext(), "加入", 0).show();
				if (Integer.parseInt(gold) >= Integer.parseInt(price)) {
				if (is_apply.equals("0")) {
					Add_club("0", "");
				} else {
					Intent intent = new Intent(RecordListClubActivity.this,
							AddApplyFormActivity.class);
					intent.putExtra("pan", "set");
					intent.putExtra("cid", cid);
					if (apply_id != null) {
						intent.putExtra("apply_id", apply_id);
					}
					startActivity(intent);
				}}else {
					Utils.showMessage(
							RecordListClubActivity.this,
							getResources().getString(
									R.string.wx_txt_111));
				}
				builder.dismiss();
			}
		});
		record_linear_quxiao.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				// Toast.makeText(getApplicationContext(), "取消", 0).show();
				builder.dismiss();
			}
		});
		return view;
	}

	private void Add_club(final String is_apply, final String content) {
		Utils.showPrgress(RecordListClubActivity.this);
		MyThreadTool.fixedThreadPool.execute(new Runnable() {
			@Override
			public void run() {
				Map<String, Object> map = new HashMap<String, Object>();
				map.put("uid", Utils.getUid(RecordListClubActivity.this));
				map.put("cid", cid);
				map.put("is_apply", is_apply);
				if (is_apply.equals("1")) {
					map.put("contents", content);
				}
				String content = Utils.sendRequest(map, Constants.BadiUrl_1
						+ "club/attendClub");
				if (content != null) {
					resultsdd = Utils.checkResult_NNN(getApplicationContext(),
							content);
					// ("加入俱乐部返回的参数是:" + content + " "
					// + resultsdd.getRetmsg());
					if (resultsdd != null
							&& !resultsdd.getRetmsg().equals("null")) {
						handler.sendEmptyMessage(2);
					} else {
						handler.sendEmptyMessage(3);
					}
				} else {
					handler.sendEmptyMessage(1);
				}
			}
		});
	}

	@SuppressLint("ValidFragment")
	public class MyRecordList0Fragment_1 extends BaseFragment implements
			IXListViewListener {
		List<Record_List_Model> list;
		// static MyRecordList0Fragment fragment;
		private XListView mListView;
		// private Handler mHandler;
		private Results results;
		private Results results3;
		private String type = null;
		private MyRecordList0FragmentAdapter fragmentAdapter;
		private List<Record_List_Model> record_List_Models;
		private DisplayImageOptions options;
		private int Page;
		int pos_ = -1;
		// private SetGetView setGetView;
		private Handler handler = new Handler() {
			public void handleMessage(Message msg) {
				switch (msg.what) {
				case 1:
					try {
						Utils.ExitPrgress(getActivity());
						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.l_net_error));
						onLoad();
					} catch (Exception e) {
						// TODO: handle exception
					}

					break;
				case 2:
					try {
						Utils.ExitPrgress(getActivity());
						record_List_Models.addAll(list);
						fragmentAdapter.notifyDataSetChanged();
						onLoad();
					} catch (Exception e) {
						// TODO: handle exception
					}

					break;
				case 3:
					try {
						Utils.ExitPrgress(getActivity());
						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.l_xa10));
						onLoad();
					} catch (Exception e) {
						// TODO: handle exception
					}

					break;
				case 5:

					try {
						Utils.ExitPrgress(getActivity());
						Utils.showMessage(getActivity(), results3.getRetmsg());
						if (results3.isRet()) {
							int d = Integer.valueOf(record_List_Models.get(pos)
									.getVote());
							record_List_Models.get(pos).setVote(++d + "");
							record_List_Models.get(pos).setVoted("1");
							fragmentAdapter.notifyDataSetChanged();
						}
						// else {
						// int d = Integer.valueOf(record_List_Models.get(pos)
						// .getVote());
						// if (d > 0) {
						// record_List_Models.get(pos).setVote(--d + "");
						// } else {
						// record_List_Models.get(pos).setVote(0 + "");
						// }
						// fragmentAdapter.notifyDataSetChanged();
						// }
					} catch (Exception e) {
						// TODO: handle exception
					}
					break;

				case 9://
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.SystemError));
					} catch (Exception e) {

					}
					break;
				case 10:// 收藏成功
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.l_xb55));

						if (pos_ != -1) {

							// mList.get(pos_).setIs_collect("1");

							record_List_Models
									.get(pos_)
									.setCollect(
											""
													+ (Integer
															.parseInt(record_List_Models
																	.get(pos_)
																	.getCollect()) + 1));
							// user_trends.get(pos_).setIs_collected(1);
							// user_trends.get(pos_).setCollect(""+(Integer.parseInt((user_trends.get(pos_).getCollect()))+1));
							fragmentAdapter.notifyDataSetChanged();
							pos_ = -1;
						}
					} catch (Exception e) {

					}
					break;
				case 11://
					Utils.ExitPrgress(getActivity());
					try {

						Utils.showMessage(getActivity(), getResources()
								.getString(R.string.l_xb113));
					} catch (Exception e) {

					}
					break;
				case 12:
					try {
						Page = 1;
						try {
							record_List_Models.clear();
						} catch (Exception e) {
							// TODO: handle exception
						}
						clubLists(cid, type, ++Page);
					} catch (Exception e) {
						// TODO: handle exception
					}

					break;
				default:
					break;
				}
			};
		};

		@Override
		public void onCreate(Bundle savedInstanceState) {
			// TODO Auto-generated method stub
			super.onCreate(savedInstanceState);
			// mHandler = new Handler();
			options = new DisplayImageOptions.Builder()
					.showStubImage(R.drawable.ic_stub)
					.showImageForEmptyUri(R.drawable.noimage)
					.showImageOnFail(R.drawable.noimage).cacheInMemory()
					.cacheOnDisc().displayer(new RoundedBitmapDisplayer(5))
					.build();
		}

		@Override
		public View onCreateView(LayoutInflater inflater, ViewGroup container,
				Bundle savedInstanceState) {
			// TODO Auto-generated method stub
			View view = inflater.inflate(R.layout.fragment_myrecordlist_me_01,
					null);
			Page = 0;
			type = getArguments().getString("type", "1");
			record_List_Models = new ArrayList<Record_List_Model>();
			mListView = (XListView) view
					.findViewById(R.id.fragment_myrecord_list_me_XlistView);
			fragmentAdapter = new MyRecordList0FragmentAdapter(getActivity());
			mListView.setXListViewListener(this);
			mListView.setPullLoadEnable(true);
			mListView.setPullRefreshEnable(true);
			mListView.setAdapter(fragmentAdapter);
			mListView.startLoadMore();
			return view;
		}

		@Override
		public void onStart() {
			// TODO Auto-generated method stub
			super.onStart();
			if (Constants.is_shuaxin) {
				handler.sendEmptyMessageDelayed(12, 700);
				Constants.is_shuaxin = false;
			}
		}

		private void clubLists(final String cid, final String type,
				final int page) {
			MyThreadTool.fixedThreadPool.execute(new Runnable() {
				@Override
				public void run() {
					list = new ArrayList<Record_List_Model>();
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("cid", cid);// 俱乐部id
					map.put("uid", Utils.getUid(RecordListClubActivity.this));// 查看者的id
					map.put("type", type);// 查看类型 1:最新记录，2:热门记录，3：投票记录
					map.put("page", page);// 第几页
					map.put("pageNum", 6);// 每页显示条数
					// ("俱乐部的记录提交数据是:" + map.toString());
					//
					String content = Utils.sendRequest(map, Constants.BadiUrl_1
							+ "record/clubLists");
					System.out.println("contentjilv" + content);
					if (content != null) {
						// ("俱乐部的记录数据是:" + content);
						//
						results = Utils.checkResult_NNN(
								getApplicationContext(), content);
						if (results != null
								&& !results.getRetmsg().equals("null")
								&& results.isRet()) {
							try {
								list = JSONUtils.getListByJsonString(
										results.getRetmsg(),
										Record_List_Model.class);
								handler.sendEmptyMessage(2);
							} catch (JSONException e) {
								// TODO Auto-generated catch block

							}
						} else {
							if (Page > 1) {
								--Page;
							} else {
								Page = 1;
							}
							handler.sendEmptyMessage(3);

						}
					} else {
						if (Page > 1) {
							--Page;
						} else {
							Page = 1;
						}
						handler.sendEmptyMessage(1);
					}
				}
			});
		}

		protected void onLoad() {
			// TODO Auto-generated method stub
			mListView.stopRefresh();
			mListView.stopLoadMore();
			mListView.setRefreshTime(""
					+ getResources().getString(R.string.ganggang));
		}

		private class MyRecordList0FragmentAdapter extends BaseAdapter {

			private Context context;

			public MyRecordList0FragmentAdapter(Context ct) {
				context = ct;
			}

			@Override
			public int getCount() {
				// TODO Auto-generated method stub
				return record_List_Models.size();
			}

			@Override
			public Object getItem(int position) {
				// TODO Auto-generated method stub
				return record_List_Models.get(position);
			}

			@Override
			public long getItemId(int position) {
				// TODO Auto-generated method stub
				return position;
			}

			@Override
			public View getView(final int position, View convertView,
					ViewGroup parent) {
				// TODO Auto-generated method stub
				// if(convertView==null)//缓存
				// LayoutInflater layoutInflater = (LayoutInflater) context
				// .getSystemService(Context.LAYOUT_INFLATER_SERVICE);// 布局填充服务
				// if (setGetView != null) {
				// convertView = setGetView.setGetView(position, convertView,
				// parent);
				// } else { iv_collect
				LayoutInflater inflater = LayoutInflater.from(context);
				convertView = inflater.inflate(
						R.layout.fragment_myrecordlist0_import_layout, null);
				// 地址
				TextView address = (TextView) convertView
						.findViewById(R.id.fragment_myrl_import_adress_textview);
				// 开始时间
				TextView startTime = (TextView) convertView
						.findViewById(R.id.f_m_i_l_starttime);
				// 结束时间
				TextView overTime = (TextView) convertView
						.findViewById(R.id.f_m_i_l_overtime);
				// 头像
				ImageView headimg = (ImageView) convertView
						.findViewById(R.id.f_m_i_l_touxiang);
				// 背景图
				ImageView background_img = (ImageView) convertView
						.findViewById(R.id.fragment_myrl_import_background_img);
				// 名字
				TextView myname = (TextView) convertView
						.findViewById(R.id.f_m_i_l_name);
				// 投票数量
				TextView votenumber = (TextView) convertView
						.findViewById(R.id.f_m_i_l_vote_number);
				// 观看数量
				TextView seenumber = (TextView) convertView
						.findViewById(R.id.f_m_i_l_see);
				// 评论数量
				TextView pinlun = (TextView) convertView
						.findViewById(R.id.f_m_i_l_say);
				// 收藏(心的标识)
				TextView collection = (TextView) convertView
						.findViewById(R.id.f_m_i_l_xin);
				ImageView iv_collect = (ImageView) convertView
						.findViewById(R.id.iv_collect);

				iv_collect.setOnClickListener(new View.OnClickListener() {

					@Override
					public void onClick(View v) {
						// TODO Auto-generated method stub
						pos_ = position;

						if (cid == null) {
							collect("0", record_List_Models.get(position)
									.getUid(), record_List_Models.get(position)
									.getRid(), "record");
						} else {
							collect(cid, record_List_Models.get(position)
									.getUid(), record_List_Models.get(position)
									.getRid(), "record");

						}

					}
				});
				// 投票
				Button f_m_i_l_toupiao = (Button) convertView
						.findViewById(R.id.f_m_i_l_toupiao);
				address.setText(record_List_Models.get(position).getName());
				startTime.setText(record_List_Models.get(position)
						.getStart_time());
				overTime.setText(record_List_Models.get(position).getEnd_time());
				votenumber.setText(record_List_Models.get(position).getVote());
				seenumber.setText(record_List_Models.get(position).getView());
				pinlun.setText(record_List_Models.get(position).getDiscuss());
				collection.setText(record_List_Models.get(position)
						.getCollect());
				ImageLoader.getInstance().displayImage(
						Constants.BadiDownImgUrl
								+ record_List_Models.get(position).getHead()
								+ Constants.appPhoto4img, headimg, options);
				// ImageLoader.getInstance().displayImage(
				// Constants.BadiDownImgUrl
				// + record_List_Models.get(position).getImage()
				// + Constants.Appactivitycover, background_img,
				// options);
				new BitmapHelp().displayImage(RecordListClubActivity.this,
						background_img, Constants.BadiDownImgUrl
								+ record_List_Models.get(position).getImage()
								+ Constants.Appactivitycover);
				background_img.setOnClickListener(new OnClickListener() {

					@Override
					public void onClick(View arg0) {
						// TODO Auto-generated method stub
						if (record_List_Models.get(position) != null) {
							Intent intent = new Intent(getActivity(),
									LogReadingActivity.class);
							if (record_List_Models.get(position).getId() != null) {
								intent.putExtra("rid",
										record_List_Models.get(position)
												.getId());
							} else if (record_List_Models.get(position)
									.getRid() != null) {
								intent.putExtra("rid",
										record_List_Models.get(position)
												.getRid());
							}
							intent.putExtra("cid", cid);
							intent.putExtra("admin_id", admin_id);
							intent.putExtra("jilu_fabiao_uid",
									record_List_Models.get(position).getUid());
							getActivity().startActivity(intent);
						}
					}
				});
				myname.setText(record_List_Models.get(position).getNickName());

				if (record_List_Models.get(position).getIs_vote().equals("1")) {
					f_m_i_l_toupiao.setVisibility(View.VISIBLE);// 权限为可以投票
					votenumber.setVisibility(View.VISIBLE);
					//
					if (record_List_Models.get(position).getVoted().equals("0")) {
						// 可投票
						f_m_i_l_toupiao
								.setOnClickListener(new OnClickListener() {
									@Override
									public void onClick(View arg0) {
										if (Utils.getUid(getActivity()) != null) {

											pos = position;
											vote(Utils.getUid(getActivity()),
													record_List_Models.get(
															position).getRid());
										} else {
											Toast.makeText(
													getActivity(),
													getResources().getString(
															R.string.l_xb10), 0)
													.show();
										}
									}
								});
					} else if (record_List_Models.get(position).getVoted()
							.equals("1")) {
						// 已经投了票了
						f_m_i_l_toupiao
								.setBackgroundResource(R.drawable.yuanpan_selector);
					}
				} else if (record_List_Models.get(position).getIs_vote()
						.equals("2")) {
					f_m_i_l_toupiao.setVisibility(View.GONE);// 权限为不可投票
					votenumber.setVisibility(View.GONE);
					//
				}

				return convertView;
			}
		}

		private void vote(final String uid, final String rid) {
			Utils.showPrgress(getActivity());
			MyThreadTool.fixedThreadPool.execute(new Runnable() {
				@Override
				public void run() {
					Map<String, Object> map = new HashMap<String, Object>();
					map.put("rid", rid);
					map.put("uid", uid);
					// ("投票数据提交的是:" + map.toString());
					String content = Utils.sendRequest(map, Constants.BadiUrl
							+ "vote");
					if (content != null) {
						// ("返回的投票数据是:" + content);
						results3 = Utils
								.checkResult_NNN(getActivity(), content);
						if (results3 != null
								&& !results3.getRetmsg().equals("null")) {
							handler.sendEmptyMessage(5);
						} else {
							handler.sendEmptyMessage(3);
						}
					} else {
						handler.sendEmptyMessage(1);
					}
				}
			});
		}

		@Override
		public void onRefresh() {
			// TODO Auto-generated method stub
			Page = 1;
			try {
				record_List_Models.clear();
			} catch (Exception e) {
				// TODO: handle exception
			}
			clubLists(cid, type, ++Page);
		}

		@Override
		public void onLoadMore() {
			// TODO Auto-generated method stub
			// All_record(++Page);
			clubLists(cid, type, ++Page);
		}

		/**
		 * 用户+俱乐部 收藏的操作接口 提交方式GET
		 * 
		 * @param $uid
		 *            ;//收藏人的id
		 * @param $cid
		 *            ;//俱乐部收藏-------仅有record，humor_trends 这两种收藏方式，当为个人收藏时，值为0
		 * @param $nuid
		 *            ;//被收藏内容所属的用户id
		 * @param $nid
		 *            ;//被收藏的内容id
		 * @param $type
		 *            ;//被收藏的类型-----个人（3种）：photo_img，record，humor_trends
		 *            俱乐部（2种）：record，humor_trends
		 */
		public void collect(String cid, String nuid, String neirong_id,
				String type) {// Constants.BadiUrl+
								// "praise_operate?uid="+uid+"&nid="+nid+"&nuid="+nuid+"&type="+type
			/*
			 * 用户收藏的操作接口 提交方式GET
			 * 
			 * @param $uid;//收藏人的id @param $nuid;//被收藏内容所属的用户id
			 * 
			 * @param $nid;//被收藏的内容id @param
			 * $type;//被收藏的类型（photo_img，record，humor_trends）
			 */
			String uid = Utils.getUid(RecordListClubActivity.this);
			Utils.showPrgress(RecordListClubActivity.this);
			CommonUtils.CommomGetfunction(getActivity(), Constants.BadiUrl
					+ "collect_operate?uid=" + uid + "&cid=" + cid + "&nuid="
					+ nuid + "&nid=" + neirong_id + "&type=" + type, handler,
					1, 9, 10, 11);
		}

	}

}
